package com.jiadeyu.anno;

import com.jiadeyu.validation.ArticleStateValidate;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

@Documented
@Target({FIELD})
@Retention(RUNTIME)
@Constraint(validatedBy = {ArticleStateValidate.class})
public @interface ArticleState {
    String message() default "state参数只支持‘已发布’或‘草稿’";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
